/**
 * @title HHOperationForm.java 
 * @description 	
 * @create 			2012-8-12 下午3:08:54 By xjiujiu
 * @package 		apps.admin.form
 * @copyright 		Copyright (c) 2011-2012 http://xyrj.hhtc.edu.cn.com. All right reserved
 * @version         $Id$
 * XYRJ-Java-Project
 */


package apps.admin.form;

import com.xyrj.core.HHObject;
import com.xyrj.core.HHPojo;
import com.xyrj.core.IHHForm;
import com.xyrj.exception.HHValidateException;
import com.xyrj.mvc.HHView;

/**
 * 操作表单
 * @ClassName: HHOperationForm 
 * @Description:
 * @author maoyun0903(maoyun19900818@163.com);
 * @date 2012-10-8 下午8:56:59 
 * @version V1.0
 */
public class HHOperationForm extends HHObject implements IHHForm
{

	/* (非 Javadoc) 
	 * <p>列表操作表单信息检测</p>
	 * 
	 * <p>description: </p> 
	 *
	 * @title  validate 
	 * @param  HHPojo pojo 需要验证的POJO对象
	 * @throws HHValidateException 
	 * @see com.xyrj.core.IHHForm#validate(com.xyrj.core.HHPojo) 
	 */
	@Override
	public void validate(HHPojo pojo) throws HHValidateException
	{
		//some code
	}

	/* (非 Javadoc) 
	 * <p>列表操作表单信息检测</p>
     * 
     * <p>description: </p> 
     *
     * @title validate 
     * @param  HHView view 当前的视图 对象
     * @throws HHValidateException 
     * @see com.xyrj.core.IHHForm#validate(com.xyrj.mvc.HHView) 
     */
    @Override
    public void validate(HHView view) throws HHValidateException
    {
    	String[] recordIds 	= view.getParameterValues("record_id");
    	if(null == recordIds || 1 > recordIds.length) {
    		throw new HHValidateException("没有选择操作的对象！");
    	}
    	if(null == view.getParameter("operation") ||
		   view.getParameter("operation").equals("")) {
    		throw new HHValidateException("没有选择需要执行的操作！");
    	}
    }

}
